/*
 * Created: Author: Aléx Carvalho / Date: May 16, 2015
 * 
 * Changed: $Author: ac280593@gmail.com $ / $Date: 2015-06-11 04:31:49 +0000 (Thu, 11 Jun 2015) $
 */
package com.cpm.view.zk;

import com.cpm.view.Alerts;
import org.zkoss.zk.ui.util.Clients;

public class AlertsImpl extends Alerts {

    @Override
    public void showInfo(String message) {
        show(message, Clients.NOTIFICATION_TYPE_INFO);
    }

    @Override
    public void showError(Throwable throwable) {
        show("Occorreu um erro inesperado!", Clients.NOTIFICATION_TYPE_ERROR);
    }

    private void show(String msg, String type) {
        Clients.showNotification(msg, type, null, "top_center", 4000, true);
    }
}
